
//求和属性的相关配置

export default{
    namespaced:true,
    actions:{
        ji(context,value){
            if (context.state.sum%2){
                context.commit('JI',value)
            }
        },
        jii(context,value){
            setTimeout(()=>{
                context.commit('JII',value)
            },500)
        }
    },
    mutations:{
        JIA(state,value){
            state.sum+=value
        },
        JIAN(state,value){
            state.sum-=value
        },
        JI(state,value){
            state.sum+=value
        },
        JII(state,value){
            state.sum+=value
        },
    },
    state:{
        sum:0,
        school:'haha',
        subject:'vue',
    },
    getters:{
        bigSum(state) {
            return state.sum*10
        }
    }
}